<template>
	<view>
		<!-- <WaterfallsFlow :wfList='periList' @itemTap="itemTap" /> -->
		<biaofun-waterfall ref="biaofunWaterfall" @tapItem="tapItem"></biaofun-waterfall>
	</view>
</template>

<script>
	import {toast} from '@/static/js/toast.js'
export default {
	data() {
		return {
			page: 1,
			periList: [],
			imglist: []
		};
	},
	onLoad() {
		this.getPeri(this.page);
		
	},
	onReachBottom(){
		// 模拟触底刷新
		this.page++
		this.getPeri(this.page)
	},
	methods: {
		getPeri(page) {
			toast('加载中...', 'none')
			uni.request({
				url: '//api.tianapi.com/meinv/index',
				data: {
					key: '1b9c3413d260a216a6395830bdfbaf34',
					rand: 2,
					page: page
				},
				success: res => {
					uni.hideToast()
					let data = res.data.newslist;
					this.$refs.biaofunWaterfall.add(data);
					// this.periList = this.periList.concat(data);
				}
			});
		},
		tapItem(item){
			uni.previewImage({
				current: 0,
				urls: [item.picUrl]
			})
		}
	}
};
</script>

<style></style>
